@echo off

:: Reverse string
:: Usage: strrev [string]
:: Reference: http://my.oschina.net/honzel/blog/185663

setlocal enableDELayedexpansion
set t1=%~1
set returnValue=%t1:~-1%
set t1=%t1:~0,-1%

:INNERREVERSE
set t2=!t1:~-1!&&set t1=!t1:~0,-1!
set returnValue=!returnValue!!t2!
if not "%t1%"=="" goto INNERREVERSE

echo %returnValue%
